package com.io.examples_shili;
import java.io.*;
public class FileMethods {

	public static void main(String[] args) {
		FileMethods fm = new FileMethods();
		File file = new File("D:/hello.txt");
		fm.showFileInfo(file);
	}
	/**
	 * ��ʾ�ļ���Ϣ
	 */
	public void showFileInfo(File file){
		if ( file.exists() ){//�ж��ļ���Ŀ¼�Ƿ����
			if ( file.isFile() ){//������ļ�
				System.out.println("����: "+file.getName());
				System.out.println("���·��: "+file.getPath());
				System.out.println("����·��: "+file.getAbsolutePath());
				System.out.println("����: "+file.length()+"�ֽ�");
			}
			if( file.isDirectory()){
				System.out.println("���ļ���Ŀ¼");
			}
		}else{
			System.out.println("�ļ�������");
		}
	}
	
	

}
